import { store as pinia } from '@/pinia';
import { useIconStore } from '@/pinia/modules/icon';
import { useDictionaryStore } from '@/pinia/modules/dictionary';
import { useEmployeeStore } from '@/pinia/modules/employee';
import { useOrganizationStore } from '@/pinia/modules/organization';
import { useSubsystemStore } from '@/pinia/modules/subsystem';
import { useSettingStore } from '@/pinia/modules/setting';

const dictionaryStore = useDictionaryStore(pinia);
const employeeStore = useEmployeeStore(pinia);
const iconStore = useIconStore(pinia);
const organizationStore = useOrganizationStore(pinia);
const settingStore = useSettingStore(pinia);
const subsystemStore = useSubsystemStore(pinia);

export const getDictionary = (dictCode) => {
  return dictionaryStore.getDictionary(dictCode);
};

export const getDictValue = (dictCode, dictKey) => {
  return dictionaryStore.getDictValue(dictCode, dictKey);
};

export const getEmployee = () => {
  return employeeStore.getEmployee();
};

export const getIconList = () => {
  return iconStore.getIconList();
};

export const getRegion = () => {
  return organizationStore.getRegion();
};

export const getUnit = () => {
  return organizationStore.getUnit();
};

export const getEntp = () => {
  return organizationStore.getEntp();
};

export const getOrganization = () => {
  return organizationStore.getOrganization();
};

export const getSetting = () => {
  return settingStore.getSetting();
};

export const getSubsystem = () => {
  return subsystemStore.getSubsystem();
};

export const clearDictionary = () => {
  return dictionaryStore.clearDictionary();
};

export const clearEmployee = () => {
  return employeeStore.clearEmployee();
};

export const clearIconList = () => {
  return iconStore.clearIconList();
};

export const clearOrganization = () => {
  return organizationStore.clearOrganization();
};

export const clearSetting = () => {
  return settingStore.clearSetting();
};

export default {
  getDictionary,
  getDictValue,
  getEmployee,
  getIconList,
  getRegion,
  getUnit,
  getEntp,
  getOrganization,
  getSetting,
  getSubsystem,
  clearDictionary,
  clearEmployee,
  clearIconList,
  clearOrganization,
  clearSetting,
}
